<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="add_so_lines_form" model="ir.ui.view">
			<field name="name">add_so_lines_form</field>
			<field name="model">sale.order.line</field>
			<field name="arch" type="xml">
				<form string="Sale Order Line">
					<sheet>
						<div class="oe_right oe_button_box" name="buttons">
	                        <button type="object"
	                            name="confirm_add_line"
	                            class="oe_stat_button"
	                            icon="fa-sign-in"
	                            string="Confirm Add">
	                        </button>
                    	</div>
                        <group>
                            <group>
                            	<field name="partner_id_parent" invisible="1"/>
                            	<field name="pricelist_id_parent" invisible="1"/>
								<field name="date_order_parent" invisible="1"/>
								<field name="fiscal_position_id_parent" invisible="1"/>
								<field name="state" invisible="1"/>
                                <field name="product_id"
                                    context="{'partner_id':partner_id_parent, 'quantity':product_uom_qty, 'pricelist':pricelist_id_parent, 'uom':product_uom}"
                                    groups="base.group_user"
                                    on_change="product_id_change(pricelist_id_parent, product_id, product_uom_qty, False, product_uos_qty, False, name, partner_id_parent, False, True, date_order_parent, False, fiscal_position_id_parent, False, context)"/>
                                <label for="product_uom_qty"/>
                                <div>
                                    <field
                                        context="{'partner_id':partner_id_parent, 'quantity':product_uom_qty, 'pricelist':pricelist_id_parent, 'uom':product_uom}"
                                        name="product_uom_qty" class="oe_inline"
                                        on_change="product_id_change(pricelist_id_parent,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,partner_id_parent, False, False, date_order_parent, False, fiscal_position_id_parent, True, context)"/>
                                    <field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"

                                        on_change="product_uom_change(pricelist_id_parent,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,partner_id_parent, False, False, date_order_parent, context)"/>
                                </div>
                                <label for="product_uos_qty" groups="product.group_uos"/>
                                <div groups="product.group_uos">
                                    <field name="product_uos_qty" class="oe_inline"/>
                                    <field name="product_uos" options='{"no_open": True}' class="oe_inline"/>
                                </div>
                                <field name="price_unit"/>
                                <label for="discount" groups="sale.group_discount_per_so_line"/>
                                <div name="discount" groups="sale.group_discount_per_so_line">
                                    <field name="discount" class="oe_inline"/> %%
                                </div>
                            </group>
                            <group>
                                <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                <field name="th_weight" invisible="1"/>
                                <!-- we should put a config wizard for these two fields -->
                                <field name="address_allotment_id" invisible="1"/>
                            </group>
                        </group>
                        <label for="name"/>
                        <field name="name"/>
                        <div groups="base.group_no_one">
                            <label for="invoice_lines"/>
                            <field name="invoice_lines"/>
                        </div>
					</sheet>
					
                </form>
			</field>
		</record>

		<record id="act_add_lines_so" model="ir.actions.act_window">
			<field name="name">Add SO Lines</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">sale.order.line</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="view_id" ref="add_so_lines_form"/>
			<field name="target">new</field>
			<field name="multi">True</field>
		</record>

	</data>
</openerp>
